//
// Created by 高森森 on 2022/1/12.
//

#include <set>
#include "Solution3.h"
string Solution3::destCity(vector<vector<string> > &paths) {
set<string>sources;
for(auto &path:paths){
    sources.insert(path[0]);
}
for(auto&path:paths){
    if(sources.find(path[1])==sources.end())
    {
        return path[1];
    }
}
}
